import Select from './select/select'
// import Map from './map'
import Image from './image'
import Number from './number'
import RemoteSelect from './remote-dialog'
import Form from './form'
import Group from './group'
import GroupCard from './group-card'
// import Datasource from './datasource'
// import Widget from './widget'
// import Event from './event'
// import GroupEvent from './group-events'

// , Map,Number, Event, GroupEvent
const components = [Select, Image, RemoteDialog, Form, Group, GroupCard, Datasource, Widget]

const install = function (Vue, opts = {}) {
    /* istanbul ignore if */
    if (install.installed) return

    components.map(component => {
        Vue.component(component.name, component)
    })
}
/* istanbul ignore if */
if (typeof window !== 'undefined' && window.Vue) {
    install(window.Vue)
}

const formField = { install, ...components }
export default formField
